package com.wudi.estate.controller.controller;

import com.github.pagehelper.PageHelper;
import com.wudi.estate.bean.admin.Permission;
import com.wudi.estate.bean.ownermanagement.Personnel;
import com.wudi.estate.mapper.admin.PermissionMapper;
import com.wudi.estate.mapper.ownermanagement.PersonnelMapper;
import com.wudi.estate.service.admin.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    PermissionMapper permissionMapper;

    @RequestMapping("/listUi")
    public String listUi(ModelMap map){
        List<Permission> permissions = permissionMapper.selectList(null);
        map.addAttribute("permissions",permissions);
        return "permission_list";

    }
    @RequestMapping("/addUi")
    public String addUi(ModelMap map){
        return "permission_add";

    }
    @RequestMapping("/editUi")
    public String editUi(ModelMap map){
        return "permission_edit";

    }
}
